# -*- coding: utf8 -*-
'''
Created on 2013-12-5

@author: zengyixun
'''

# Python 2 code
import urllib
import urllib2
 
url = 'http://www.blog.pythonlibrary.org/wp-content/uploads/2012/06/wxDbViewer.zip'
 
print "downloading with urllib"
urllib.urlretrieve(url, "code.zip")
 
print "downloading with urllib2"
f = urllib2.urlopen(url)
data = f.read()
with open("code2.zip", "wb") as code:
    code.write(data)
